<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@include file="./header.jsp" %>

<head> 

<script>
		/* var host = window.location.host;
		if(host == 'o9mr.com' || host == 'www.o9mr.com'){
			window.location.href = "${ctx }/detailGoodsD/199";
		} else {
			if(jWei.util.isMobile()){
				window.location.href = "${ctx }/m";
			}
		} */
		
	</script>
	<style>
		.goods-area{
			display: none;
		}
		
		.hot-box{
			margin-top:20px;margin-left:0px;margin-right:0px;background:#F2F2F2;
		}
		
		.hot-box .thumbnail{
			border:0px;
			padding:0px;
		}
		
		 
		
		.categorys{
			float:left;
		}
		
		.categorys li{
			float: left;
			list-style: none;
			margin-right:10px;
		}
		.categorys li a{
			line-height: 75px;
			height:75px;
			display: block;
			color:#093;
			text-decoration: none;
		}
		
		
	
	
	
	</style>
	
	 
</head>

<body class="grayback" >
<tags:topPC/>

	
	
	
	
	
	  
	<!-- begin公告 -->
	
	<div class="panel panel-info" id="announcement" style="display:none;width:200px;position: absolute;top:55px;left:0px;z-index:100;">      
	     <div class="panel-heading">
	      <h3 class="panel-title">公告</h3>
	      <span class="glyphicon glyphicon-remove" id="close_announcement_id" style="position: absolute;top:10px;left:172px;cursor:pointer;"></span>     
	    </div>
	    <div class="panel-body"> 
	      	
	    </div>
	</div>
	<!-- end公告 -->
	
	<div class="bs-example">
      <div id="carousel-example-captions" class="carousel slide" data-ride="carousel">
         
        <div class="carousel-inner">
          <div class="item active">
          	<a href="${ctx}/pdiscount/" target="_blank"><img data-src="holder.js/900x500/auto/#777:#777" alt="900x500" src="https://img.alicdn.com/imgextra/i2/914260183/TB2ouBVkpXXXXaSXpXXXXXXXXXX_!!914260183.jpg"></a>
            <div class="carousel-caption">
              <h3 style="color:#F97;"></h3>
              <p></p>
            </div>
          </div>
          
          
        </div>
<!--          <a class="left carousel-control" href="#carousel-example-captions" data-slide="prev"> -->
<!--           <span class="glyphicon glyphicon-chevron-left"></span> -->
<!--         </a> -->
<!--         <a class="right carousel-control" href="#carousel-example-captions" data-slide="next"> -->
<!--           <span class="glyphicon glyphicon-chevron-right"></span> -->
<!--         </a> -->
      </div>
    </div>
	
	<div  style="background: #333335;padding-bottom:20px;">
    <div class="container"  id="goods_main_id">
		<!-- begin 人气单品专区 -->
		
<!-- 		<div style="color:red;font-size:30px;line-height:40px;margin-top:10px;"> -->
<!-- 			至广大客户：我们客服只会电话和短信核实订单信息，别的电话都是骗子请客户们不要相信！ -->
<!-- 		</div> -->
		<div id="hot_area_id">
			<div style="color:#666;font-weight: bold;margin-top:20px;margin-bottom:-20px;">
	  			<div style="height:46px;width:111px;background: url('${ctx}/images/xstm.jpg');"><span style="height:0px;font-size:0px;">人气单品</span>
	  			</div>
			</div>
			
			 
 
		 
			
		<div class="row hot-box" id="hot_model_id" style="display: none;position: relative;">
						    		<img src="./images/xszk.png" style="position: absolute;top:0px;left:0px;z-index:1;"/> 
				
				<div class="col-md-6" style="padding-left:0px;">
		    	<div class="thumbnail" style="margin-bottom:0px;">
		    		<a href="#" class="img-a" target="_blank"><img alt="" class="img-box" src=""></a>
		    	</div>
		      	  
	  		</div>
	  			<div class="col-md-6" style="">
			    <div><a href="#" class="title-a"  style="font-size:14px;color:#666;text-decoration: none;line-height:30px;" target="_blank"></a></div>
			    
			     <div class="buy" style="margin-bottom:10px;margin-top:10px;margin-right:-40px;">
			     		<div style="background:#ff5500;height:65px;line-height: 65px;">
			     			<div class="row">
			     				<div  class="col-md-8 col-sm-8 col-xs-12" >
			     					<span style="color:#fff;padding-left:5px;">限时价：</span> 
			     					<span style="color:#fff;font-size:26px;" class="nowprice"></span>
			     					<span style="background: #ffe400;font-size:13px;padding-left:4px;padding-right:4px;">货到付款，顺丰包邮</span>
			     				</div>
			     				<div class="col-md-4 col-sm-4 col-xs-12">
			     					<a type="button" id="register_btn" data-buy="yes" class="btn btn-lg btn-qg"   style="border-radius:0px;background: #ffe400;color:#ff5500;"  href="#" target="_blank">去抢购></a>
			     				</div>
			     			</div>
			     		</div>
			     		
			     		
			    </div>
			    
			    <style>
			    
			    .other_info_box {
    width: 100%;
    background-image: url(./images/hotbg.png);
    background-repeat: no-repeat;
    height: 94px;
    overflow: hidden;
}
			    	.old_price_box{
			    		height: 47px;
					    border-bottom: 1px #e5e5e5 solid;
					    padding: 6px 0;
					    overflow: hidden;
					    
			    	}
			    	
			    	.old_price_box .fl{
			    		float:left;
			    	}
			    	
			    	.old_price_box .text_line {
					    line-height: 20px;
					    height: 32px;
					    overflow: hidden;
					    padding: 6px 0;
					}
					.old_price_box .old_price_cont span {
    padding-left: 8px;
    color: #666;
}

.old_price_box .text_line span {
    line-height: 20px;
    vertical-align: middle;
    color: #666;
}

.old_price_box .save_cont .save {
    color: #e60012;
    font-size: 22px;
    font-weight: 700;
    line-height: 20px;
}

.old_price_box .save_cont .save em {
    font-style: normal;
    color: #e60012;
    font-weight: 100;
    font-size: 15px;
    margin-left: 6px;
    margin-right: 3px;
}

.old_price_box .paid_sum_cont .paid_sum {
    margin-right: 3px;
    font-size: 14px;
    color: #e60012;
    background-position: 1px -50px;
}

.old_price_box .text {
    color: #666;
}
					.old_price_box .paid_sum_cont {
    padding: 0 33px;
    margin-top: 7px;
    background-position: 18px -48px;
    line-height: 20px;
    height: 32px;
    overflow: hidden;
}
					
					.old_price_box .save_cont {
    margin-left: 48px;
    line-height: 20px;
    height: 32px;
    overflow: hidden;
    padding: 6px 0;
}

.cut_time_bar {
    padding: 0 8px;
    line-height: 44px;
    width: 522px;
    height: 46px;
}

.ct_text{padding:0 3px;color:#333;vertical-align:baseline}

.ct_num{font-size:20px;line-height:18px;color:#333}


			    </style>
			    <div class="utuan_goods_show_v2" style="overflow: hidden;">
			     			<div class="other_info_box">
						    <div class="old_price_box">
						        <p class="text_line old_price_cont fl"><span>原价：</span><span class="old_price" style="text-decoration: line-through; "></span></p>
						        <p class="text_line save_cont fl"><span>立省：</span><span class="save"><em class="yahei">¥</em><span style="color:#e60012;" class="jieshen"></span></span></p>
						            <p class="text_line paid_sum_cont fr" style="display: block;"><span class="paid_sum"></span><span class="text">人已购买</span></p>
						 
						    </div>
						    <p class="cut_time_bar fl" id="timer_div" cut-time="238367"><span class="fl cut_text">距团购结束还剩：</span><span style="color:#000;font-size:22px;"  id="timer_id"></span></p>
						</div>
			     		</div>
			    
			    <div style="margin-top:15px;display: none;" id="recommend_div">
			    	<div style="color:#5cb85c;font-size:20px;">
			    		名鞋团购网推荐理由：
			    	</div>
			    	<div style="font-size:16px;color:#999;" class="recommend"> 
			    	</div>
			    </div>
			    
			     <div style="margin-top:15px;display: none;" id="scene_div">
			    	<div style="color:#5cb85c;font-size:20px;">
			    		适合场景：
			    	</div>
			    	<div style="font-size:16px;color:#999;" class="scene"> 
			    	</div>
			    </div>
			    
			    <div style="margin-top:15px;margin-bottom:10px;display: none;" id="tips_div" > 
			    	<div style="color:#999;font-size:20px;">
			    		温馨提示：
			    	</div>
			    	<div style="font-size:16px;color:#D9534F;font-weight: bold;" class="tips"> 
			    	</div>
			    </div>
	            
	  		</div>
	  		
	  		
	  		
  		</div>
  		
 
		</div>
			
		<!-- end 人气单品专区 -->
		
		 
    </div>
    
    </div>
    
    <!-- begin model -->
	    <div class="thumbnail shopbox" id="goods_new_model" style="display: none;">
	      <div style="width:56px;height:24px;position: absolute;z-index:30;top: 0px;right:0px;background: url('${ctx}/images/hot.png') no-repeat;"></div>
	     	  <a href="#" class="img-a" target="_blank"><img alt="" src="${ctx }/images/loading.png"></a>
	      
	      <div class="caption">
	        <a href="#" target="_blank" class="title-a" style="text-decoration: none;"><h6 class="title ellipsis" style="color:#666;"></h6></a>
	        
	        <p class="content" style="margin:0px;">
	        	<strong class="nowprice" style="color:#F76120;font-size:20px;font-weight: bold;height: 31px;line-height: 31px;"></strong>
	        	<span class="oldprice" style="color:#9F9F9F;font-size:14px;text-decoration:line-through;"></span>
	        	<span style="background: #D2322D;color:#FFF;font-size:14px;">货到付款</span>
	        </p>
	        
	        <div align="" style="margin-bottom:5px;">
	        	<span style="font-size:12px;color:#666;"><span class="buy-num" style="padding-right:5px;"></span>人已经购买</span>
	        </div>
	        <p align=""><a href="#" target="_blank" class="btn btn-buy btn-block" role="button">立即抢购</a></p>
	      </div>
	      
	  	</div>
  	<!-- end model -->
  	
	
	<tags:bottomPC/>
	<script>
		$(function(){
				var sh; 
				var col = 3;
				//获取人气单品
				jQuery.ajax({
					type : 'Get',
					contentType : 'application/json',
					url : "${ctx}/goods/hotList.do?pageSize=16&grade=5&currPage=1&categoryId=0",
					async:false,
					dataType : 'json',
					success:function(dataObj){
			        	var list = dataObj.obj.goodsList;
			        	var commentList = dataObj.obj.commentList;
			        	for(var i = 0 ;i<list.length;i++){
			        		var colDiv = $("#hot_area_id");
								var model = $("#hot_model_id").clone();
				        		model.attr("id","");
				        		var goods = list[i];
				        		var commentCount = commentList[i];
				        		var price = goods.price;
				        		if(goods.picName.indexOf("http") != -1){
				        			model.find(".img-box").attr("src",goods.picName).attr("title",goods.title).attr("alt",goods.title);
				        		}else{
				        			model.find(".img-box").attr("src","${ctx}/upload/download.do?fileName="+goods.picName).attr("title",goods.title).attr("alt",goods.title);	
				        		}
								
				            	model.find(".img-a").attr("href","${ctx}/pdetailGoods/"+goods.id);
		            			model.find(".title-a").attr("href","${ctx}/pdetailGoods/"+goods.id).html(goods.title);
				            	model.find(".btn-qg").attr("href","${ctx}/pdetailGoods/"+goods.id);
				            	if(goods.expiredDate){
				            		
				            		model.find("#timer_div").show();
				            		var jDom = model.find("#timer_id");
				            		if(i == 0){
				            			var jDom1 = $("#timer_total_id");
					            		sh=setInterval(_fresh(goods.expiredDate,jDom1),100);	
				            		}
				            		
				    				sh=setInterval(_fresh(goods.expiredDate,jDom),100); 
				            	}
				            
				            	
				            	model.find("#comment_id").html(commentCount+"个好评");
				            	model.find(".paid_sum").html(goods.buyNum);
				            	model.find(".nowprice").html("￥"+goods.nowPrice+".00");
				            	model.find(".old_price").html("￥"+price+".00");
				            	model.find(".jieshen").text(price-goods.nowPrice);
				            	if(goods.recommend){
				            		model.find("#recommend_div").show();
				            		model.find(".recommend").html("”"+goods.recommend+"”");
				            	}
				            	if(goods.scene){
				            		model.find("#scene_div").show();
				            		model.find(".scene").html(goods.scene);
				            	}
				            
				            	if(goods.tips){
				            		model.find("#tips_div").show();
				            		model.find(".tips").html(goods.tips);
				            	}
				            	
				            	model.show();
				            	colDiv.append(model);
			        	}
					}
				});
				
				 
				/**
				*倒计时函数
				**/
				function _fresh(date,jDom)  
				{  
				return function(){
					 var endtime=new Date(date);  
					 var nowtime = new Date();  
					 var leftsecond=parseInt((endtime.getTime()-nowtime.getTime())/1000);  
					 __d=parseInt(leftsecond/3600/24);  
					 __h=parseInt((leftsecond/3600)%24);  
					 __m=parseInt((leftsecond/60)%60);  
					 __s=parseInt(leftsecond%60);  
					var c=new Date();
					var q=((c.getMilliseconds())%10);
					jDom.html(__d+"天 "+__h+"小时"+__m+"分"+__s+"."+q+"秒");
					 if(leftsecond<=0){  
					 jDom.html("抢购已结束");
					 clearInterval(sh);  
					 }  
				};
				}  
				
				//获取上架品牌
				jQuery.ajax({
					type : 'Get',
					contentType : 'application/json',
					url : '${ctx}/brands/getAlllAddOn.do',
					cache:true,
					async:false,
					data : {
					},
					dataType : 'json',
					success : function(data) {
						if (data.result) {
							var brandsList = data.obj;
							if(brandsList){
								var html = "";
								for(var i = 0 ;i<brandsList.length;i++){
									var brands = brandsList[i];
									if(brands){
									 
										//设置图片品牌分类
										var cloneLi = $("#brands_img_model_id").clone();
										cloneLi.find("a").attr("href",_ctx+"/discount/?brands="+brands.id+"#名鞋专场");
										cloneLi.find("img").attr("src",_ctx+"/upload/download.do?fileName="+brands.pic);
										$(".brands").append(cloneLi);
										cloneLi.show(); 
									}
								}
								$("#brands_img_div_bottom").append($("#brands_img_div_top").html());
							}
							
						} else {
							//alert('数据库异常,查询数据失败');
						}
					},
					error : function(data) {
					}
				});	
				
				
				
				//公告管理
				jQuery.ajax( {
						type : 'Get',
						url : '${ctx}/announcement/getAnnouncement.do',
						dataType : 'json',
						contentType : 'application/json',
						async:false,
						success : function(data) {
							if(data.result){
								//后台设置为显示
								if(data.obj.isShow == 1){
									$("#announcement .panel-body").html("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"+data.obj.content); 
									$("#announcement").fadeIn();	
								}
							}
						}
				});
				$("#close_announcement_id").click(function(){
					$("#announcement").fadeOut();
				});
		});
	</script>
	
</body>